package com.gugee.ins.data.monitor.config;

import com.gugee.ins.data.common.config.KafkaProducerCommon;
import com.gugee.ins.data.common.msg.EventMsg;
import com.gugee.ins.data.common.msg.InsBloggerMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.kafka.support.serializer.JsonSerializer;


/**
 * KafkaProducerInsBloggerConfig
 * @author Huangxin
 */
@Configuration
@EnableKafka
public class KafkaProducerMonitorMsgConfig {
    /**
     *
     * @return
     */
    @Bean("kafkaTemplateMonitor")
    public KafkaTemplate<Long, EventMsg> kafkaTemplateMonitor(KafkaProducerCommon kafkaProducerCommon) {
        return new KafkaTemplate<>(kafkaProducerCommon.myKafkaProducerFactory(JsonSerializer.class));
    }
}
